Skip to main content
Version: 2.x.x

SocketConfig


import { SocketConfig } from "@hyper-fetch/sockets"

Description

Defined in socket/socket.types.ts:21

Preview

type SocketConfig<SocketClientType> = (SocketConfigBaseType<SocketClientType> & { clientOptions?: ServerSentEventsClientOptionsType; isSSE: true }) | (SocketConfigBaseType<SocketClientType> & { clientOptions?: WebsocketClientOptionsType });

Structure

{auth:Record<string, ClientQueryParam>,autoConnect:boolean,client:SocketClientType,queryParams:\Record<string, ClientQueryParam>\ | \string\,queryParamsConfig:{arrayFormat:\bracket\ | \index\ | \comma\ | \separator\ | \bracket-separator\ | \none\,arraySeparator:string,encode:boolean,skipEmptyString:boolean,skipNull:boolean,strict:boolean},queryParamsStringify:(queryParams: \ClientQueryParamsType\ | \string\ | \NegativeTypes\) => string,reconnect:number,reconnectTime:number,url:string,clientOptions:{eventSourceInit:EventSourceInit,reconnectTimeout:number},isSSE:true} | {auth:Record<string, ClientQueryParam>,autoConnect:boolean,client:SocketClientType,queryParams:\Record<string, ClientQueryParam>\ | \string\,queryParamsConfig:{arrayFormat:\bracket\ | \index\ | \comma\ | \separator\ | \bracket-separator\ | \none\,arraySeparator:string,encode:boolean,skipEmptyString:boolean,skipNull:boolean,strict:boolean},queryParamsStringify:(queryParams: \ClientQueryParamsType\ | \string\ | \NegativeTypes\) => string,reconnect:number,reconnectTime:number,url:string,clientOptions:{heartbeat:boolean,heartbeatMessage:string,pingTimeout:number,pongTimeout:number,protocols:string[],reconnectTimeout:number}}